using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using HISModels.Entities;

namespace HISModels.Mapping
{
	public class PoMasterMap : EntityTypeConfiguration<PoMaster>
	{
		public PoMasterMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.CodeValue)
				.HasMaxLength(20);
				
			this.Property(t => t.Shipping)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("PoMasters");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.CodeValue).HasColumnName("CodeValue");
			this.Property(t => t.PoDate).HasColumnName("PoDate");
			this.Property(t => t.SupplierId).HasColumnName("SupplierId");
			this.Property(t => t.TermOfPayment).HasColumnName("TermOfPayment");
			this.Property(t => t.DueDate).HasColumnName("DueDate");
			this.Property(t => t.SiteId).HasColumnName("SiteId");
			this.Property(t => t.Shipping).HasColumnName("Shipping");
			this.Property(t => t.DeliveryCharge).HasColumnName("DeliveryCharge");
			this.Property(t => t.Flag).HasColumnName("Flag");
		}
	}
}

